

from random import randint as r
def juzhen():
    m,n=map(int,input("请输入矩阵的行数和列数（空格分开）：").split())
    # n=map(int,input("请输入矩阵的列数："))
    list_sum=[]
    print("生成的矩阵为：")
    for i in range(m):
        list_n=[]
        for j in range(n):
            list_n.append(r(0,100))
            print("{0: >4}".format(list_n[j]),end="")
            list_sum.append(list_n[j])
        print()
    print(list_sum)
juzhen()
juzhen()

